<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表单</title>
    <script src="../build/react.min.js"></script>
    <script src="../build/react-dom.min.js"></script>
    <script src="../build/browser.min.js"></script>
</head>
<body>
<div id="example"></div>
<script type="text/babel">
    var MyInput = React.createClass({
        getInitialState: function () {
            return {value: 'Hello！'};
        },
        handleChange: function (event) {
            this.setState({value: event.target.value});
        },
        render: function () {
            var value = this.state.value;
            return (
                    <div>
                        <input type="text" value={value} onChange={this.handleChange} />
                        <p>{value}</p>
                    </div>
            );
        }
    });
    ReactDOM.render(
            <MyInput />,
            document.getElementById('example')
    );
</script>
</body>
</html>